package ro.msg.quiz.domain;

//AUTHOR: Marco,Razvan,Elod

//Object that has id, question text, correct answer
public class TextQuestion extends Question {

    private String answer;

    public TextQuestion(int id, String text, String answer) {
	super(id, text);
	this.setAnswer(answer);
    }

    /**
     * @return the type
     */
    @Override
    public QuestionType getType() {
	return QuestionType.TEXT_Q;
    }

    /**
     * @return the answer
     */
    public String getAnswer() {
	return answer;
    }

    /**
     * @param answer
     *            the answer to set
     */
    public void setAnswer(String answer) {
	this.answer = answer;
    }

    @Override
    public String toString() {
	return this.getId() + " " + this.getType().get() + " '" + this.getText() + "' '" + this.answer + "'";
    }

}
